<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统配置','表头管理']" icon="fa fa-cog" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span><h2>表头管理</h2></header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">
									<span class="module_text">菜单名称</span>
									<div class="s_hover_box">
										<select class="select2" id="repairPointSelect2">
											<option value=''></option>
										</select>
										<div class="s_del_icon" (click)='delRepairPoint()'>x</div>
									</div>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button  type="button"  class="btn btn-primary" (click)="new_resource(HeaderModal)" >新增表头</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="table_search()" class="search-input" placeholder="资源名称...">
								<span class="top-search-box">
							        <button class="top-search-btn" type="button" (click)="table_search()"> <i class="fa fa-search"></i></button>
							    </span>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>操作</th>
										<th>字段名称</th>
										<th>字段标识</th>
										<th>资源名称</th>
										<th>资源标识</th>
										<th>更新时间</th>
										<th>是否启用</th>
										<th>备注</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData" >
										<td>
											<button type="button" (click)="updata_resource(row,HeaderModal)">编辑</button>
											<button type="button" (click)="del_resource(row)">删除</button>
										</td>
										<td>{{row.field}}</td>
										<td>{{row.fieldName}}</td>
										<td>{{row.menuName}}</td>
										<td>{{row.mark}}</td>
										<td>{{row.updateTime}}</td>
										<td class="smart-form" style="padding: 7px 10px;">
											<input  style="margin-right: 5px;display: none;" name="status" class="isStatus" type="checkbox"  [checked]="row.isStatus" [id]='row.id' [attr.title]="row.mark">
										</td>
										<td>{{row.remark}}</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount"
						           [rows]="pageSize"
						           [currentPage]="curPage - 1"
						           (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
	<!-- 新增项目车辆   弹窗-->
	<section bsModal #HeaderModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="headerClose(HeaderModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>     
					<h4 class="modal-title"><span *ngIf="formType == 'new'">新增</span><span *ngIf="formType == 'updata'">编辑</span>表头</h4>
				</div>
				<form id="HeaderFrom"  class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-4 col-sm-2">字段名称<sup>*</sup></label>
								<div class="col-xs-10">
									<input class="form-control" name="field" [(ngModel)]='headerFrom.field' placeholder="字段名称" />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-4 col-sm-2">字段标识<sup>*</sup></label>
								<div class="col-xs-10">
									<input class="form-control" [disabled]="formType == 'updata'?true:false" name="fieldName" [(ngModel)]='headerFrom.fieldName' placeholder="字段标识" />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-4 col-sm-2">菜单名称<sup>*</sup></label>
								<div class="s_hover_box col-xs-10">
									<select class="select2" id="menuName" style="width: 100%;height: 32px;line-height: 32px;">
										<option value=''></option>
									</select>
									<div class="s_del_icon" (click)='delRepairPoint2()' style="right: 20px; top: 8px">x</div>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-4 col-sm-2">备注</label>
								<div class="col-xs-10">
									<input class="form-control" name="remark" [(ngModel)]='headerFrom.remark' placeholder="备注" />
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="control-label col-xs-4 col-sm-2">是否启用</label>
								<div class="col-sm-10">
									<label class="radio radio-inline" style="margin-right: 40px;">
										<input type="radio" class="radiobox" [checked]="isShared" (change)="isSharedChange($event.target.value)" value='1' name="isEnable">
										<span>启用</span>
									</label>
									<label class="radio radio-inline" style="margin-right: 40px;">
										<input type="radio" class="radiobox" [checked]="!isShared" (change)="isSharedChange($event.target.value)" value='0' name="isEnable">
										<span>停用</span>
									</label>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="headerClose(HeaderModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="headerSubmit(HeaderModal)">确认</button>
					</div>
				</form>
			</div>
		</div>
	</section>
	<!-- 新增项目车辆 弹窗end-->
</div>